
package com.naza.rpc.netty.handler;

import com.naza.rpc.serialize.hessian.HessianCodecUtil;
import com.naza.rpc.serialize.hessian.HessianDecoder;
import com.naza.rpc.serialize.hessian.HessianEncoder;
import com.naza.rpc.netty.RpcReceiveHandler;
import io.netty.channel.ChannelPipeline;

import java.util.Map;

/**
 * RPC服务端  Hessian 编解码  处理(RpcReceiveHandler)
 * @author yl
 */
public class HessianRecvHandler implements NazaRecvHandler {
    @Override
    public void handle(Map<String, Object> handlerMap, ChannelPipeline pipeline) {
        HessianCodecUtil util = new HessianCodecUtil();
        pipeline.addLast(new HessianEncoder(util));
        pipeline.addLast(new HessianDecoder(util));
        pipeline.addLast(new RpcReceiveHandler(handlerMap));
    }
}

